#include <stdio.h>

#include "jae.h"
#include "defaultWindow.h"

using namespace jae;

int main( int argc, char* argv[] )
{
    int result = 0;
    
    //Create JAE
    JustAnotherEngine *pEngine = new JustAnotherEngine(argc, argv);
    
    //Create SceneManager
    JAE_SceneManager *pSceneManager = pEngine->createSceneManager();
    pSceneManager->getRootNode()->show();
    
    //Create example window
    JAE_DefaultWindow *pWindow = new JAE_DefaultWindow(pSceneManager, NULL); 
    pWindow->setWindowTitle("JustAnotherEngine Example01");
    pWindow->showFPS();
    pWindow->getCamera()->show();

    //without Fullscreen:
    pWindow->resize(1024, 768); //or SetFixedSize(...)
    pWindow->show();
    
    //Fullscreen:
    //(The method "setFixedSize(1024, 768)" is needless here, because it's already done in "setScreenResolution()")
    //pEngine->setScreenResolution(1024, 768, 32);
    //pWindow->showFullScreen();
        
    //start the application
    
    //Load Modell
    JAE_Object* pCar = pSceneManager->createObject("data/ToonCar.ms3d");
    pCar->setScaleFactor(0.01f);
    
    result = pEngine->exec();

    //Shutdown Engine
    delete pWindow;
    delete pEngine;
    

    return result;
}
